.\"
.\" This file and its contents are supplied under the terms of the
.\" Common Development and Distribution License ("CDDL"), version 1.0.
.\" You may only use this file in accordance with the terms of version
.\" 1.0 of the CDDL.
.\"
.\" A full copy of the text of the CDDL should have accompanied this
.\" source.  A copy of the CDDL is also available via the Internet at
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
.\" Copyright 2020 Oxide Computer Company
.\"
.Dd June 14, 2022
.Dt VIOBLK 4D
.Os
.Sh NAME
.Nm vioblk
.Nd virtio block device
.Sh SYNOPSIS
.Pa /dev/dsk/cXt0d0
.Pa /dev/rdsk/cXt0d0
.Sh DESCRIPTION
The
.Nm
driver is a
.Xr blkdev 4D
based device that supports the virtio para-virtualization block device
specification which is commonly used by many hypervisors and emulators.
The device supports what the specification calls the more commonly found
.Sq legacy
interface for devices.
.Pp
The driver supports the following features, if offered by the device:
.Bl -dash
.It
Volatile write-cache
.It
Discarding unused sectors
.Pq ala TRIM, UNMAP
.It
Read-only device support
.It
Physical block sizes that are distinct from logical 512-byte blocks
.It
Synthesized disk geometry
.El
.Sh APPLICATION PROGRAMMING INTERFACE
For each device instance, a
.Xr blkdev 4D
instance is created and treated as an independent controller with a
single device, meaning that the
.Em cX
part of
.Em cXt0d0
will vary for each device.
Because the driver leverages the
.Xr blkdev 4D
framework, most standard disk manipulation utilities will function such
as
.Xr diskinfo 8
for discovering devices,
.Xr format 8
for manipulating partition tables,
.Xr iostat 8
for seeing device I/O statistics, and a subset of the
.Xr dkio 4I
ioctl requests to retrieve information about the device.
.Sh ARCHITECTURE
The
.Nm
driver is only supported on
.Sy x86 .
.Sh FILES
.Bl -tag -width Pa
.It Pa /dev/dsk/cXt0d0
Block device minor node.
.It Pa /dev/rdsk/cXt0d0
Character device minor node.
.It Pa /kernel/drv/amd64/vioblk
x86 device driver.
.El
.Sh SEE ALSO
.Xr blkdev 4D ,
.Xr vioscsi 4D ,
.Xr virtio 4D ,
.Xr dkio 4I ,
.Xr diskinfo 8
.Rs
.%T Virtual I/O Device (VIRTIO) Version 1.1
.%D April, 2019
.%U https://docs.oasis-open.org/virtio/virtio/v1.1/virtio-v1.1.html
.Re
